<template>
  <div>
    <px-tabs v-model="activeWater" class="equipment-tabs" style="margin-bottom: 10px; margin-left: 10px; background: none">
      <px-tab-pane v-for="(item, index) in tabPaneList" :key="index" :name="item.name">
        <template #label>
          <p class="pane-bottom">{{ item.label }}</p>
          <p class="pane-line" />
        </template>
      </px-tab-pane>
    </px-tabs>
    <px-row style="height: 64px">
      <px-col :span="24" class="water_col">
        <div class="waterdom borderRidus boxShadow">
          <px-form ref="queryRef" class="custom-form-ui" :model="queryParams" :inline="true" label-width="90px">
            <px-radio-group v-model="radio" style="position: relative; top: -12px; margin-right: 16px" @change="handleQuery">
              <px-radio-button label="日" />
              <px-radio-button label="月" />
              <px-radio-button label="年" />
            </px-radio-group>

            <px-form-item label="日期" style="width: 516px !important">
              <px-date-picker
                v-model="dateRange"
                type="datetimerange"
                start-placeholder="开始时间"
                end-placeholder="结束时间"
                format="YYYY-MM-DD HH:mm:ss"
                value-format="YYYY-MM-DD HH:mm:ss"
                :default-time="defaultTime"
              />
            </px-form-item>
            <px-form-item label="厂区">
              <px-select v-model="queryParams.testItem" placeholder="请选择" clearable style="width: 240px" filterable>
                <px-option v-for="dict in factoryList" :key="dict.id" :label="dict.itemName" :value="dict.itemValue" />
              </px-select>
            </px-form-item>
            <px-button style="margin-top: -17px" type="primary" icon="" @click="handleQuery()">查询</px-button>
            <px-button style="margin-top: -17px" icon="" @click="resetQuery">重置</px-button>
          </px-form>
        </div>
      </px-col>
    </px-row>
    <px-row v-if="activeWater == 'pure'" style="margin-top: 16px" :gutter="16">
      <px-col :span="24" class="water_col" style="margin-bottom: 16px">
        <div class="waterdom borderRidus boxShadow">
          <modelTitle title="能源消耗" />
          <px-table :data="tableData1" border show-summary style="width: 100%; margin-top: 16px">
            <px-table-column prop="id" label="序号" width="60" />
            <px-table-column prop="name" label="系统名称" />
            <px-table-column prop="tb1" label="电-消耗量(Kwh)" />
            <px-table-column prop="tb2" label="38℃水-消耗量(m³)" />
            <px-table-column prop="tb3" label="90℃水-消耗量(m³)" />
            <!-- <px-table-column prop="tb4" label="64℃水-消耗量" /> -->
            <px-table-column prop="tb5" label="12℃水-消耗量" />
            <px-table-column prop="tb6" label="CAD(m³)" />
            <px-table-column prop="tb7" label="GN2(m³)" />
            <px-table-column prop="tb8" label="PN2(m³)" />
          </px-table>
        </div>
      </px-col>
      <px-col :span="24" class="water_col" style="margin-bottom: 16px">
        <div class="waterdom borderRidus boxShadow">
          <modelTitle title="化学品消耗" />
          <px-table :data="tableData2" border show-summary style="width: 100%; margin-top: 16px">
            <px-table-column prop="id" label="序号" width="60" />
            <px-table-column prop="name" label="系统名称" />
            <px-table-column prop="tb1" label="杀菌剂(吨)" />
            <px-table-column prop="tb2" label="PAC(吨)" />
            <px-table-column prop="tb3" label="NaOH(吨)" />
            <px-table-column prop="tb4" label="NaCLO(吨)" />
            <px-table-column prop="tb5" label="NaBr(吨)" />
            <px-table-column prop="tb6" label="HCL(吨)" />
          </px-table>
        </div>
      </px-col>
    </px-row>
    <px-row v-if="activeWater == 'waste'" style="margin-top: 16px" :gutter="16">
      <px-col :span="24" class="water_col" style="margin-bottom: 16px">
        <div class="waterdom borderRidus boxShadow">
          <modelTitle title="能源消耗" />
          <px-table :data="tableData3" border show-summary style="width: 100%; margin-top: 16px">
            <px-table-column prop="id" label="序号" width="60" />
            <px-table-column prop="name" label="废水" />
            <px-table-column prop="tb1" label="电-消耗量(Kwh)" />
            <!-- <px-table-column prop="tb2" label="38℃水-消耗量" /> -->
            <px-table-column prop="tb3" label="90℃水-消耗量(m³)" />
            <!-- <px-table-column prop="tb4" label="64℃水-消耗量" /> -->
            <!-- <px-table-column prop="tb5" label="12℃水-消耗量" /> -->
            <px-table-column prop="tb6" label="CAD(m³)" />
            <px-table-column prop="tb7" label="GN2(m³)" />
            <!-- <px-table-column prop="tb8" label="PN2(m3)" /> -->
          </px-table>
        </div>
      </px-col>
      <px-col :span="24" class="water_col" style="margin-bottom: 16px">
        <div class="waterdom borderRidus boxShadow">
          <modelTitle title="化学品消耗" />
          <px-table :data="tableData4" border show-summary style="width: 100%; margin-top: 16px">
            <px-table-column prop="id" label="序号" width="60" />
            <px-table-column prop="name" label="水课系统" />
            <px-table-column prop="tb1" label="营养盐(吨)" />
            <px-table-column prop="tb2" label="消泡剂(吨)" />
            <px-table-column prop="tb3" label="铜络合计(吨)" />
            <px-table-column prop="tb4" label="除氟剂(吨)" />
            <px-table-column prop="tb5" label="PAM(吨)" />
            <px-table-column prop="tb6" label="PAC(吨)" />
            <px-table-column prop="tb7" label="NaOH(吨)" />
            <px-table-column prop="tb8" label="NaHSO3(吨)" />
            <px-table-column prop="tb9" label="H2SO4(吨)" />
            <px-table-column prop="tb10" label="CaCL2(吨)" />
          </px-table>
        </div>
      </px-col>
    </px-row>
  </div>
</template>
<script setup lang="ts">
import modelTitle from "@/views/common/components/modelTitle/index.vue";
import chartswwt from "./components/chartswwt.vue";
import { getCurrentInstance, ref, toRefs, reactive, onMounted } from "vue";
import { queryChildByTypeCodeAndItemValue } from "@/api/waterClass";
import { testQualityqueryReport } from "@/api/waterQualityDetection";
const data = reactive({
  queryParams: {
    systemCode: "",
    samplingLocationCode: "",
    testItem: "",
    samplingTimeStart: "",
    samplingTimeEnd: ""
  },
  tableData: [
    {
      taskNo: "1",
      taskName: "任务名称",
      responsible: "责任人",
      status: "ONGOING"
    }
  ],
  syetemList: [],
  samplingLocationList: [],
  dateRange: [],
  testItemList: [],
  chartsList: [],
  tableData1: [],
  tableData2: [],
  tableData3: [],
  tableData4: []
});
const factoryList = [
  {
    itemName: "全厂",
    itemValue: 1
  },
  {
    itemName: "分厂1",
    itemValue: 2
  },
  {
    itemName: "分厂2",
    itemValue: 3
  }
];
const {
  queryParams,
  tableData1,
  tableData2,
  tableData3,
  tableData4,
  tableData,
  syetemList,
  samplingLocationList,
  dateRange,
  testItemList,
  chartsList
} = toRefs(data);
const activeWater = ref("pure");
const tabPaneList = [
  {
    label: "纯水",
    name: "pure"
  },
  {
    label: "废水",
    name: "waste"
  }
];
const radio = ref("时");
const getRandomInt = (min, max) => {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1)) + min;
};
tableData1.value = [
  {
    id: 1,
    name: "纯水生产线",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120)
  },
  {
    id: 2,
    name: "纯水验证线",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120)
  },
  {
    id: 3,
    name: "LSR",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120)
  },
  {
    id: 4,
    name: "Rinse",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120)
  },
  {
    id: 5,
    name: "给排水",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120)
  }
];

tableData2.value = [
  {
    id: 1,
    name: "纯水生产线",
    tb1: getRandomInt(100, 160),
    tb2: getRandomInt(100, 160),
    tb3: getRandomInt(100, 160),
    tb4: getRandomInt(100, 160),
    tb5: getRandomInt(100, 160),
    tb6: getRandomInt(100, 160)
  },
  {
    id: 2,
    name: "纯水验证线",
    tb1: getRandomInt(100, 160),
    tb2: getRandomInt(100, 160),
    tb3: getRandomInt(100, 160),
    tb4: getRandomInt(100, 160),
    tb5: getRandomInt(100, 160),
    tb6: getRandomInt(100, 160)
  },
  {
    id: 3,
    name: "LSR",
    tb1: getRandomInt(100, 160),
    tb2: getRandomInt(100, 160),
    tb3: getRandomInt(100, 160),
    tb4: getRandomInt(100, 160),
    tb5: getRandomInt(100, 160),
    tb6: getRandomInt(100, 160)
  },
  {
    id: 4,
    name: "Rinse",
    tb1: getRandomInt(100, 160),
    tb2: getRandomInt(100, 160),
    tb3: getRandomInt(100, 160),
    tb4: getRandomInt(100, 160),
    tb5: getRandomInt(100, 160),
    tb6: getRandomInt(100, 160)
  }
];

tableData3.value = [
  {
    id: 1,
    name: "酸碱废水系统",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120)
  },
  {
    id: 2,
    name: "含氟废水系统",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120)
  },
  {
    id: 3,
    name: "含氨废水系统",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120)
  },
  {
    id: 4,
    name: "含钴废水系统",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120)
  },
  {
    id: 5,
    name: "含铜废水系统",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120)
  }
];

tableData4.value = [
  {
    id: 1,
    name: "酸碱废水系统",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120),
    tb9: getRandomInt(100, 120),
    tb10: getRandomInt(100, 120)
  },
  {
    id: 2,
    name: "含氟废水系统",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120),
    tb9: getRandomInt(100, 120),
    tb10: getRandomInt(100, 120)
  },
  {
    id: 3,
    name: "含氨废水系统",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120),
    tb9: getRandomInt(100, 120),
    tb10: getRandomInt(100, 120)
  },
  {
    id: 4,
    name: "含钴废水系统",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120),
    tb9: getRandomInt(100, 120),
    tb10: getRandomInt(100, 120)
  },
  {
    id: 5,
    name: "含铜废水系统",
    tb1: getRandomInt(100, 120),
    tb2: getRandomInt(100, 120),
    tb3: getRandomInt(100, 120),
    tb4: getRandomInt(100, 120),
    tb5: getRandomInt(100, 120),
    tb6: getRandomInt(100, 120),
    tb7: getRandomInt(100, 120),
    tb8: getRandomInt(100, 120),
    tb9: getRandomInt(100, 120),
    tb10: getRandomInt(100, 120)
  }
];

const defaultTime: [Date, Date] = [new Date(2000, 1, 1, 0, 0, 1), new Date(2000, 1, 1, 23, 59, 59)];

function formatDate(date) {
  const year = date.getFullYear();
  const month = (date.getMonth() + 1).toString().padStart(2, "0");
  const day = date.getDate().toString().padStart(2, "0");
  const h = date.getHours().toString().padStart(2, "0");
  const m = date.getMinutes().toString().padStart(2, "0");
  const s = date.getSeconds().toString().padStart(2, "0");
  return `${year}-${month}-${day} ${h}:${m}:${s}`;
}

const handleQuery = () => {
  let parmas = {
    systemCode: queryParams.value.systemCode,
    samplingLocationCode: queryParams.value.samplingLocationCode,
    testItem: queryParams.value.testItem,
    samplingTimeStart: dateRange.value[0],
    samplingTimeEnd: dateRange.value[1]
  };
  tableData1.value = [
    {
      id: 1,
      name: "纯水生产线",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120)
    },
    {
      id: 2,
      name: "纯水验证线",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120)
    },
    {
      id: 3,
      name: "LSR",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120)
    },
    {
      id: 4,
      name: "Rinse",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120)
    },
    {
      id: 5,
      name: "给排水",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120)
    }
  ];

  tableData2.value = [
    {
      id: 1,
      name: "纯水生产线",
      tb1: getRandomInt(100, 160),
      tb2: getRandomInt(100, 160),
      tb3: getRandomInt(100, 160),
      tb4: getRandomInt(100, 160),
      tb5: getRandomInt(100, 160),
      tb6: getRandomInt(100, 160)
    },
    {
      id: 2,
      name: "纯水验证线",
      tb1: getRandomInt(100, 160),
      tb2: getRandomInt(100, 160),
      tb3: getRandomInt(100, 160),
      tb4: getRandomInt(100, 160),
      tb5: getRandomInt(100, 160),
      tb6: getRandomInt(100, 160)
    },
    {
      id: 3,
      name: "LSR",
      tb1: getRandomInt(100, 160),
      tb2: getRandomInt(100, 160),
      tb3: getRandomInt(100, 160),
      tb4: getRandomInt(100, 160),
      tb5: getRandomInt(100, 160),
      tb6: getRandomInt(100, 160)
    },
    {
      id: 4,
      name: "Rinse",
      tb1: getRandomInt(100, 160),
      tb2: getRandomInt(100, 160),
      tb3: getRandomInt(100, 160),
      tb4: getRandomInt(100, 160),
      tb5: getRandomInt(100, 160),
      tb6: getRandomInt(100, 160)
    }
  ];

  tableData3.value = [
    {
      id: 1,
      name: "酸碱废水系统",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120)
    },
    {
      id: 2,
      name: "含氟废水系统",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120)
    },
    {
      id: 3,
      name: "含氨废水系统",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120)
    },
    {
      id: 4,
      name: "含钴废水系统",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120)
    },
    {
      id: 5,
      name: "含铜废水系统",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120)
    }
  ];

  tableData4.value = [
    {
      id: 1,
      name: "酸碱废水系统",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120),
      tb9: getRandomInt(100, 120),
      tb10: getRandomInt(100, 120)
    },
    {
      id: 2,
      name: "含氟废水系统",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120),
      tb9: getRandomInt(100, 120),
      tb10: getRandomInt(100, 120)
    },
    {
      id: 3,
      name: "含氨废水系统",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120),
      tb9: getRandomInt(100, 120),
      tb10: getRandomInt(100, 120)
    },
    {
      id: 4,
      name: "含钴废水系统",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120),
      tb9: getRandomInt(100, 120),
      tb10: getRandomInt(100, 120)
    },
    {
      id: 5,
      name: "含铜废水系统",
      tb1: getRandomInt(100, 120),
      tb2: getRandomInt(100, 120),
      tb3: getRandomInt(100, 120),
      tb4: getRandomInt(100, 120),
      tb5: getRandomInt(100, 120),
      tb6: getRandomInt(100, 120),
      tb7: getRandomInt(100, 120),
      tb8: getRandomInt(100, 120),
      tb9: getRandomInt(100, 120),
      tb10: getRandomInt(100, 120)
    }
  ];
  // testQualityqueryReport(parmas).then(res => {
  //   console.log(res);
  //   chartsList.value = res;
  // });
};
const resetQuery = () => {
  queryParams.value = {
    systemCode: "",
    samplingLocationCode: "",
    testItem: "",
    samplingTimeStart: "",
    samplingTimeEnd: ""
  };
  dateRange.value = [];
};
</script>

<style scoped lang="scss">
.water_col {
  height: 100%;
}

.waterdom {
  width: 100%;
  height: 100%;
  padding: 16px 24px;
  background-color: #fff;
  border-radius: 4px;
}

.first_width {
  width: calc(100% - 16px);
}

.model_chart {
  position: relative;
  width: 100%;
  height: calc(100% - 40px);
  margin-top: 10px;

  .co2img {
    position: absolute;
    top: 32px;
    left: 22px;
    width: 32px;
    height: 32px;
  }

  .titlep {
    position: absolute;
    top: 29px;
    left: 70px;
    font-size: 16px;
    font-weight: 400;
    color: #000;
  }

  .titlevalue {
    position: absolute;
    top: 55px;
    left: 70px;

    .titlevalue1 {
      float: left;
      font-size: 20px;
      font-weight: 600;
      line-height: 28px;
      color: #3b82f6;
    }

    .titlevalue1span {
      font-size: 16px;
      font-weight: 400;
      line-height: 22px;
      color: #4f4f4f;
    }

    .titlevalue2 {
      float: left;
      margin-top: 5px;
      margin-left: 20px;
      font-size: 14px;
      font-weight: 400;
      line-height: 20px;
      color: #000;
    }

    .titlevalue2span {
      display: inline-block;
      margin-left: 8px;
      font-size: 14px;
      line-height: 20px;
      color: #f87171;
    }
  }

  .co2mian {
    position: absolute;
    top: 112px;
    left: 0;
    width: 100%;
    height: 92px;
  }

  .co2mianleft {
    float: left;
    width: 50%;
    height: 100%;

    .co2mianleftp {
      width: calc(100% - 21px);
      height: 22px;
      padding-left: 20px;
      font-size: 14px;
      font-weight: 400;
      line-height: 20px;
      color: #000;
      border-right: 1px solid #cbcdd8;
    }
  }

  .co2mianright {
    float: left;
    width: 50%;
    height: 100%;

    .co2mianrightp {
      width: calc(100% - 45px);
      height: 22px;
      padding-left: 45px;
      font-size: 14px;
      font-weight: 400;
      line-height: 20px;
      color: #000;
    }
  }

  .co2mianleftp2 {
    margin-left: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #3b82f6;

    .co2mianleftp2span {
      font-size: 14px;
      font-weight: 400;
      color: #4f4f4f;
    }
  }

  .co2mianleftp3 {
    float: left;
    margin-left: 20px;
    font-size: 14px;
    font-weight: 400;
    color: #000;

    .titlevalue2span {
      display: inline-block;
      margin-left: 8px;
      font-size: 14px;
      line-height: 20px;
      color: #34d399;
    }
  }
}

.percentage-value {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.percentage-label {
  display: block;
  margin-top: 10px;
  font-size: 16px;
}

.percentage-value2 {
  display: block;
  margin-top: 10px;
  font-size: 20px;
}

.percentage-label2 {
  display: block;
  margin-top: 10px;
  font-size: 14px;
}

.percentage-value3 {
  display: block;
  margin-top: 10px;
  font-size: 20px;
  color: #f00;
}

.percentage-label3 {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  color: #f00;
}

.jindu1 {
  margin: 24px 0 0 17px;
}

.jindu2 {
  margin: 38px calc((100% - 103px) / 2);
}

.jindu1p {
  width: calc(100% - 24px);
  margin-top: 0;
  font-size: 16px;
  text-align: center;
}

.jindu2p {
  width: 100%;
  margin-top: -40px;
  font-size: 14px;
  text-align: center;
}

:deep(.px-table) {
  .px-table__cell {
    padding: 6px 0;
  }

  .px-table__header-wrapper,
  .px-table__fixed-header-wrapper {
    th {
      background-color: #e7eefb !important;
    }
  }
}
</style>
